﻿-- =========================================================================================================
-- Author:		MICHAEL RITACCO
-- Copyright:	2010 MEKHANO GROUP LLC
-- Version:		08/21/2010 1.0
-- =========================================================================================================
CREATE PROCEDURE [flcrTM].[api_tm_device_sel]
	(@DEVICE_UDT AS flcr.DEVICE_UDT READONLY)
AS
BEGIN
	SELECT 	[TM_DEVICE_ID]
			,[TIME_KEY]
			,[DEVICE_ID]
			,[AUDIT_USER]
			,[AUDIT_DTTM]
			,[AUDIT_DTTM_TZ] 
			,[AUDIT_MOD_USER]
			,[AUDIT_MOD_DTTM]
			,[AUDIT_MOD_DTTM_TZ] 
			,[RLS_MASK]
			,[RLS_OWNER]
			,[WRKFL_ITEM_ID]
			,[WRKFL_STATUS_ID]
			,[ACTIVE_FLG]
			,[DEVICE_ASSET_NAME]
			,[DEVICE_SERIAL_NUM]
			,[DEVICE_ASSET_TAG]
			,[PARENT_ID]
			,[DEVICE_TYPE]
			,[DEVICE_PLATFORM_ID]
			,[DOMAIN_ID]
			,[ORG_ID]
			,[RESOURCE_ID]
			,[SLA_ID]
			,[FACILITY_ID]
			,[ENV_ID] 
	  FROM	flcrTm.[DEVICE]
	 WHERE	[DEVICE_ID] IN (SELECT DEVICE_ID FROM @DEVICE_UDT)
	 ORDER BY [DEVICE_ID]

END